package com.xc.freeapp.service.impl;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xc.freeapp.dao.UserLivingMapper;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.UserLiving;
import com.xc.freeapp.service.UserLivingService;

@Service
public class UserLivingServiceImpl implements UserLivingService {
	private Logger log = Logger.getLogger(this.getClass());
	@Autowired
	UserLivingMapper userLivingMapper ;
	public int insert(UserLiving record){
		DBContextHolder.switchDataSourceRW();//切换数据源
		Integer count=0;
		try{
			count= userLivingMapper.insert(record);
		}catch(Exception e){
			log.info("插入日活数据出错");
		}
		return  count;
	}
}
